@extends('Admin.Index.index')
@section('title')
    商品属性值修改
@endsection
@section('content')
<div class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-user-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">
                <span class="c-red">*</span>
                商品属性值名称：</label>
            <div class="formControls col-xs-6 col-sm-6">
                @foreach($p_data as $v)
                <input type="text" class="input-text" id="property_value_name" value="{{$v->p_value}}">
                    @endforeach
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">
                属性值-价格：</label>
            <div class="formControls col-xs-6 col-sm-6">
                @foreach($p_data as $v)
                <input type="text" class="input-text" id="property_value_price" value="{{$v->price}}">
                    @endforeach
            </div>
        </div>
        <div class="row cl">
            <div class="col-9 col-offset-2">
                <button class="btn btn-primary radius" id="property_value_update" type="button" >提交</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    $(function(){
        $('#property_value_update').click(function () {
            var p_value = $('#property_value_name').val();
            var price = $('#property_value_price').val();
            $.post('',{p_value:p_value,price:price},function (e) {
                //console.log(e);
                if(e.status)
                {
                    layer.msg('更改成功',{icon:6},function () {
                        window.location.reload();
                    });
                }else {
                    layer.msg(e.info,{icon:5});
                }
            })
        });
    });
</script>
@endsection